home
***
CD-ROM
|
disk
|
FTP
|
other
***
search
/
Visual Basic Controls
/
Visual Basic Controls.iso
/
vbcontrol
/
axcool
/
axcool.ctl
< prev
next >
Wrap
Text File
|
1998-10-27
|
16KB
|
437 lines
VERSION 5.00
Begin VB.UserControl axCool
Alignable = -1 'True
CanGetFocus = 0 'False
ClientHeight = 450
ClientLeft = 0
ClientTop = 0
ClientWidth = 6435
MaskColor = &H00C0C0C0&
PropertyPages = "axCool.ctx":0000
ScaleHeight = 30
ScaleMode = 3 'Pixel
ScaleWidth = 429
ToolboxBitmap = "axCool.ctx":0010
Begin axCoolbar.axCoolButton btnCool
Height = 330
Index = 1
Left = 45
TabIndex = 0
ToolTipText = "Button1"
Top = 45
Visible = 0 'False
Width = 330
_ExtentX = 582
_ExtentY = 582
BeginProperty Font {0BE35203-8F91-11CE-9DE3-00AA004BB851}
Name = "MS Sans Serif"
Size = 8.25
Charset = 0
Weight = 400
Underline = 0 'False
Italic = 0 'False
Strikethrough = 0 'False
EndProperty
MaskColor = -2147483633
End
End
Attribute VB_Name = "axCool"
Attribute VB_GlobalNameSpace = False
Attribute VB_Creatable = True
Attribute VB_PredeclaredId = False
Attribute VB_Exposed = True
Attribute VB_Ext_KEY = "PropPageWizardRun" ,"Yes"
Option Explicit
'Default Property Values:
Const m_def_BorderStyle = 2
'Property Variables:
Private m_BorderStyle As Integer
Private mNodes As New CollectionEx
Private bShowFlatGrey As Boolean
Private bTextLabels As Boolean
Public Enum AxBorderStyles
[No Border] = 0
[Single] = 1
[Thin Raised] = 2
[Thick Raised] = 3
[Thin Inset] = 4
[Thick Inset] = 5
[Etched] = 6
[Bump] = 7
End Enum
'Event Declarations:
Event Click(Index As Integer)
Attribute Click.VB_Description = "Occurs when the button is pushed"
Event DropDownClick(Index As Integer)
Attribute DropDownClick.VB_Description = "Occurs when the dropdown button is clicked"
Private Sub btnCool_Click(Index As Integer)
RaiseEvent Click(Index)
End Sub
Private Sub btnCool_DropDownClick(Index As Integer)
RaiseEvent DropDownClick(Index)
End Sub
'Initialize Properties for User Control
Private Sub UserControl_InitProperties()
m_BorderStyle = m_def_BorderStyle
bShowFlatGrey = False
bTextLabels = False
UserControl.Height = 400
UserControl.Width = 6435
End Sub
Private Sub UserControl_Paint()
Dim di As Long
Dim rc As RECT
'draw outside border
Select Case m_BorderStyle
Case [No Border]
Case [Single]
di = GetClientRect(UserControl.hwnd, rc)
di = DrawEdge(UserControl.hdc, rc, BDR_RAISEDOUTER, BF_RECT Or BF_MONO)
Case [Thin Raised]
di = GetClientRect(UserControl.hwnd, rc)
di = DrawEdge(UserControl.hdc, rc, BDR_RAISEDINNER, BF_TOPLEFT)
di = DrawEdge(UserControl.hdc, rc, BDR_RAISEDOUTER, BF_BOTTOMRIGHT)
Case [Thick Raised]
di = GetClientRect(UserControl.hwnd, rc)
di = DrawEdge(UserControl.hdc, rc, EDGE_RAISED, BF_TOPLEFT)
di = DrawEdge(UserControl.hdc, rc, EDGE_RAISED, BF_BOTTOMRIGHT)
Case [Thin Inset]
di = GetClientRect(UserControl.hwnd, rc)
di = DrawEdge(UserControl.hdc, rc, BDR_SUNKENINNER, BF_TOPLEFT)
di = DrawEdge(UserControl.hdc, rc, BDR_SUNKENOUTER, BF_BOTTOMRIGHT)
Case [Thick Inset]
di = GetClientRect(UserControl.hwnd, rc)
di = DrawEdge(UserControl.hdc, rc, EDGE_SUNKEN, BF_TOPLEFT)
di = DrawEdge(UserControl.hdc, rc, EDGE_SUNKEN, BF_BOTTOMRIGHT)
Case [Etched]
di = GetClientRect(UserControl.hwnd, rc)
di = DrawEdge(UserControl.hdc, rc, EDGE_ETCHED, BF_TOPLEFT)
di = DrawEdge(UserControl.hdc, rc, EDGE_ETCHED, BF_BOTTOMRIGHT)
Case [Bump]
di = GetClientRect(UserControl.hwnd, rc)
di = DrawEdge(UserControl.hdc, rc, EDGE_BUMP, BF_TOPLEFT)
di = DrawEdge(UserControl.hdc, rc, EDGE_BUMP, BF_BOTTOMRIGHT)
End Select
End Sub
'Load property values from storage
Private Sub UserControl_ReadProperties(PropBag As PropertyBag)
Dim iTotCnt As Integer, Index As Integer
UserControl.Enabled = PropBag.ReadProperty("Enabled", True)
m_BorderStyle = PropBag.ReadProperty("BorderStyle", m_def_BorderStyle)
bShowFlatGrey = PropBag.ReadProperty("ShowFlatGrey", False)
bTextLabels = PropBag.ReadProperty("TextLabels", False)
iTotCnt = PropBag.ReadProperty("Count", 0)
'ReDim mOtlData(totcnt)
For Index = 1 To iTotCnt
AddItem
Set mNodes.Item(Index).Bitmap = PropBag.ReadProperty("List_1" & Index, Nothing)
mNodes.Item(Index).Caption = PropBag.ReadProperty("List_2" & Index, "")
mNodes.Item(Index).Enabled = PropBag.ReadProperty("List_3" & Index, 1)
mNodes.Item(Index).Style = PropBag.ReadProperty("List_4" & Index, 0)
mNodes.Item(Index).Tag = PropBag.ReadProperty("List_5" & Index, "")
mNodes.Item(Index).ToolTipText = PropBag.ReadProperty("List_6" & Index, "")
mNodes.Item(Index).Visible = PropBag.ReadProperty("List_7" & Index, 1)
mNodes.Item(Index).DropDown = PropBag.ReadProperty("List_8" & Index, 0)
Next
ShowButtons
End Sub
Private Sub UserControl_Resize()
If bTextLabels Then
UserControl.Height = 720
Else
UserControl.Height = 400
End If
UserControl.Cls
UserControl_Paint
End Sub
'Write property values to storage
Private Sub UserControl_WriteProperties(PropBag As PropertyBag)
Dim Index As Integer
Call PropBag.WriteProperty("Enabled", UserControl.Enabled, True)
Call PropBag.WriteProperty("BorderStyle", m_BorderStyle, m_def_BorderStyle)
Call PropBag.WriteProperty("ShowFlatGrey", bShowFlatGrey, False)
Call PropBag.WriteProperty("TextLabels", bTextLabels, False)
Call PropBag.WriteProperty("Count", mNodes.Count, 0)
For Index = 1 To mNodes.Count
Call PropBag.WriteProperty("List_1" & Index, mNodes(Index).Bitmap)
Call PropBag.WriteProperty("List_2" & Index, mNodes(Index).Caption)
Call PropBag.WriteProperty("List_3" & Index, mNodes(Index).Enabled)
Call PropBag.WriteProperty("List_4" & Index, mNodes(Index).Style)
Call PropBag.WriteProperty("List_5" & Index, mNodes(Index).Tag)
Call PropBag.WriteProperty("List_6" & Index, mNodes(Index).ToolTipText)
Call PropBag.WriteProperty("List_7" & Index, mNodes(Index).Visible)
Call PropBag.WriteProperty("List_8" & Index, mNodes(Index).DropDown)
Next
End Sub
'WARNING! DO NOT REMOVE OR MODIFY THE FOLLOWING COMMENTED LINES!
'MappingInfo=UserControl,UserControl,-1,Enabled
Public Property Get Enabled() As Boolean
Attribute Enabled.VB_Description = "Returns/sets a value that determines whether an object can respond to user-generated events."
Enabled = UserControl.Enabled
End Property
Public Property Let Enabled(ByVal New_Enabled As Boolean)
UserControl.Enabled() = New_Enabled
PropertyChanged "Enabled"
End Property
Sub ShowAboutBox()
Attribute ShowAboutBox.VB_Description = "Show About box"
Attribute ShowAboutBox.VB_UserMemId = -552
frmAbout.Show vbModal
Unload frmAbout
Set frmAbout = Nothing
End Sub
Public Property Get BorderStyle() As AxBorderStyles
Attribute BorderStyle.VB_Description = "Returns/sets the border style for the control."
BorderStyle = m_BorderStyle
End Property
Public Property Let BorderStyle(ByVal New_BorderStyle As AxBorderStyles)
If Not (m_BorderStyle = New_BorderStyle) Then
m_BorderStyle = New_BorderStyle
UserControl.Cls
UserControl_Paint
End If
PropertyChanged "BorderStyle"
End Property
''MappingInfo=UserControl,UserControl,-1,Ambient
'Pub